package com.yunhe.policyfulfillment.policyful.repository;

import com.yunhe.policyfulfillment.policyful.domain.PolicyInfoMatter;
import com.yunhe.policyfulfillment.policyful.model.PolicyInfoMatterQueryCondition;
import com.yunhe.policyfulfillment.policyful.model.PolicyInfoMatterVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ClassName IPolicyInfoMatter
 * @Description TODO
 * @Author HeTao
 * @Date 2021/7/26 14:20
 * @Version 1.0
 **/
@Repository
public interface IPolicyInfoMatterRepository {


    /**
     * 新增
     * @author hetao
     * @date 2021/07/26
     **/
    int createPolicyInfoMatter(PolicyInfoMatter policyInfoMatter);

    /**
     * 新增
     * @author hetao
     * @date 2021/07/26
     **/
    int createPolicyInfoMatterSelective(PolicyInfoMatter policyInfoMatter);

    /**
     * 刪除
     * @author hetao
     * @date 2021/07/26
     **/
    int deletePolicyInfoMatterByPrimaryKey(@Param("id") long id);

    /**
     * 更新
     * @author hetao
     * @date 2021/07/26
     **/
    int updatePolicyInfoMatterByPrimaryKey(PolicyInfoMatter policyInfoMatter);

    /**
     * 更新
     * @author hetao
     * @date 2021/07/26
     **/
    int updatePolicyInfoMatterByPrimaryKeySelective(PolicyInfoMatter policyInfoMatter);

    /**
     * 根据主键查询
     * @author hetao
     * @date 2021/07/26
     **/
    PolicyInfoMatter searchPolicyInfoMatterByPrimaryKey(@Param("id") long id);

    PolicyInfoMatter searchPolicyInfoMatterByCode(@Param("code")String code);

    List<PolicyInfoMatterVo> findPolicyInfoMatterByQueryCondition(PolicyInfoMatterQueryCondition policyInfoMatterQueryCondition);

    int getOnlineMatterCount();

    int getDeclaringMatterCount();

    void updateMatterAccessCountById(@Param("id") long id,@Param("accessCount") long accessCount);

    long getTotalMatterAccessCount();

    long getDeclaredQuantity();

    void publishTimedMatter();

    void updateMatterDeclaringStatus();

    void updateMatterHasEndedStatus();

    void updateMatterDeclaredQuantityById(@Param("id") long id,@Param("declaredQuantity") long declaredQuantity);

    Integer getPolicyMatterCount(@Param("year") int year);

    List<PolicyInfoMatterVo> findPolicyInfoMatterByQueryConditionForPortal(PolicyInfoMatterQueryCondition policyInfoMatterQueryCondition);
}
